/**
 * article模块接口列表
 */

import base from '../base' // 导入接口域名列表
import axios from '@/common/utils/http' // 导入http中创建的axios实例
import qs from 'qs' // 根据需求是否导入qs模块

const order = {
  // 验证码
  /**
   * @param {Object} params - {receiver, recaptcha_response}
   * */
  // 订单
  orderList (params) {
    return axios.get(`${base.gene}/order/orders/`)
  },
  orderCreate (params) {
    return axios.post(`${base.gene}/order/orders/`, params)
  },
  orderDetail (id, params) {
    return axios.get(`${base.gene}/order/orders/${id}/`, {
      params: params
    })
  },
  orderPayment (params) {
    return axios.post(`${base.gene}/order/order_payment/`, qs.stringify(params))
  },
  // 样本绑定
  codeBind (params) {
    return axios.post(`${base.gene}/order/codes/`, qs.stringify(params))
  }
}

export default order
